package com.fcscs.ecms.gwt.server;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.fcscs.core.gwt.server.FcsRemoteServiceServlet;
import com.fcscs.core.system.ApplicationContextHolder;
import com.fcscs.ecms.domain.GlobalHotelEntity;
import com.fcscs.ecms.domain.GlobalLanguage;
import com.fcscs.ecms.domain.GlobalModuleInfo;
import com.fcscs.ecms.domain.GlobalModuleType.ModuleType;
import com.fcscs.ecms.domain.GlobalPicture;
import com.fcscs.ecms.domain.GlobalRoomType;
import com.fcscs.ecms.domain.GlobalText;
import com.fcscs.ecms.domain.HotelEntityView;
import com.fcscs.ecms.domain.MdlEntertainmentDynamicField;
import com.fcscs.ecms.domain.MdlEntertainmentElmts;
import com.fcscs.ecms.domain.MdlEntertainmentMain;
import com.fcscs.ecms.domain.MdlHelpMain;
import com.fcscs.ecms.gwt.client.ECMSCommonService;
import com.fcscs.ecms.service.ECMSCommonManager;

public class ECMSCommonServiceImpl extends FcsRemoteServiceServlet implements
		ECMSCommonService {

	private static final long serialVersionUID = 1975629521745188086L;

	private ECMSCommonManager mgr = (ECMSCommonManager) ApplicationContextHolder
			.getBeanFromContext("ecmsCommonManager");

	@Override
	public GlobalLanguage saveGlobalLanguage(GlobalLanguage entity) {
		return mgr.saveGlobalLanguage(entity);
	}

	@Override
	public GlobalText saveGlobalText(GlobalText entity) {
		return mgr.saveGlobalText(entity);
	}

	@Override
	public GlobalPicture saveGlobalPicture(GlobalPicture entity) {
		return mgr.saveGlobalPicture(entity);
	}

	@Override
	public GlobalHotelEntity saveGlobalHotelEntity(GlobalHotelEntity entity) {
		// TODO Auto-generated method stub
		return mgr.saveGlobalHotelEntity(entity);
	}

	@Override
	public int saveGlobalHotelRoomTypeList(int idHotel,
			List<Integer> listRoomType) {
		// TODO Auto-generated method stub
		return mgr.saveGlobalHotelRoomTypeList(idHotel, listRoomType);
	}

	@Override
	public List<GlobalRoomType> getRoomType() {
		// TODO Auto-generated method stub
		return mgr.getRoomType();
	}

	@Override
	public List<String> getText(int id, String langId) {
		// TODO Auto-generated method stub
		return mgr.getText(id, langId);
	}

	@Override
	public List<Integer> getHotelRoomTypeList(int idHotel) {
		// TODO Auto-generated method stub
		return mgr.getHotelRoomTypeList(idHotel);
	}

	@Override
	public List<GlobalPicture> getImage(int id) {
		// TODO Auto-generated method stub
		return mgr.getImage(id);
	}

	@Override
	public List<GlobalHotelEntity> getHotel(int id) {
		// TODO Auto-generated method stub
		return mgr.getHotel(id);
	}

	@Override
	public List<GlobalHotelEntity> getHotels() {
		// TODO Auto-generated method stub
		return mgr.getHotels();
	}

	@Override
	public HotelEntityView getHotelEntityView(int idHotel) {
		// TODO Auto-generated method stub
		return mgr.getHotelEntityView(idHotel);
	}

	@Override
	public boolean deleteHotelRoomTypeList(int idHotel,
			List<Integer> roomTypeList) {
		// TODO Auto-generated method stub
		return mgr.deleteHotelRoomTypeList(idHotel, roomTypeList);
	}

	@Override
	public boolean deleteHotel(int idHotel) {
		// TODO Auto-generated method stub
		return mgr.deleteHotel(idHotel);
	}

	@Override
	public MdlEntertainmentMain getEntertainment(int orgId, int propId,
			boolean isSchedule) {
		return mgr.getEntertainment(orgId, propId, isSchedule);
	}
	
	@Override
	public MdlEntertainmentMain getEntertainment(int entMainId) {
		return mgr.getEntertainment(entMainId);
	}

	@Override
	public List<MdlEntertainmentDynamicField> getEntertainmentDynamicFieldList() {
		return mgr.getEntertainmentDynamicFieldList();
	}

	@Override
	public Map<String, String> getLanguageMap() {
		return mgr.getLanguageMap();
	}

	@Override
	public MdlEntertainmentMain saveEntertainment(int orgId, int propId,
			int userId, boolean isSchedule,  Date startDate, Date startTime, Map<String, String> titleTextMap,
			Map<String, String> subTitleTextMap, byte[] menuPictureData,
			String url, List<MdlEntertainmentElmts> entElmtsList) {
		return mgr.saveEntertainment(orgId, propId, userId, isSchedule, startDate, startTime,
				titleTextMap, subTitleTextMap, menuPictureData, url,
				entElmtsList);
	}

	@Override
	public GlobalPicture updateGlobalPicture(GlobalPicture entity) {
		// TODO Auto-generated method stub
		return mgr.updateGlobalPicture(entity);
	}

	@Override
	public int saveGlobalHotelEntity(List<Map<String, String>> listtext,
			GlobalHotelEntity entity, GlobalPicture[] llistPic) {
		// TODO Auto-generated method stub
		return mgr.saveGlobalHotelEntity(listtext, entity, llistPic);
	}

	@Override
	public int editGlobalHotelEntity(List<Map<String, String>> listtext,
			GlobalHotelEntity entity, GlobalPicture[] llistPic) {
		// TODO Auto-generated method stub
		return mgr.editGlobalHotelEntity(listtext, entity, llistPic);
	}

	@Override
	public int editGlobalHotelRoomType(int idHotel,
			List<Integer> oldlistRoomType, List<Integer> newRoomType) {
		// TODO Auto-generated method stub
		return mgr.editGlobalHotelRoomType(idHotel, oldlistRoomType,
				newRoomType);
	}

	@Override
	public int deleteHotelentity(GlobalHotelEntity entity,
			List<Integer> roomTypeList) {
		// TODO Auto-generated method stub
		mgr.deleteHotelentity(entity, roomTypeList);
		return 1;
	}

	@Override
	public GlobalModuleInfo getGlobalModuleInfoTemplateByName(int orgId,
			int propId, ModuleType type, String templateName) {
		return mgr.getGlobalModuleInfoTemplateByName(orgId, propId, type, templateName);
	}
	
	@Override
	public List<GlobalModuleInfo> getGlobalModuleInfoTemplateList(int orgId,
			int propId, ModuleType type) {
		return mgr.getGlobalModuleInfoTemplateList(orgId, propId, type);
	}
	
	@Override
	public void saveEntertainmentTemplate(int orgId, int propId, int userId,
			Map<String, String> titleTextMap,
			Map<String, String> subTitleTextMap, byte[] menuPictureData,
			String url, List<MdlEntertainmentElmts> entElmtsList,
			String templateName) {
		mgr.saveEntertainmentTemplate(orgId, propId, userId, titleTextMap, subTitleTextMap, menuPictureData, url, entElmtsList, templateName);
	}

	@Override
	public GlobalModuleInfo getModuleHelp(int orgId, int propId,
			boolean isSchedule) {
		return mgr.getModuleHelp(orgId, propId, isSchedule);
	}

	@Override
	public GlobalModuleInfo getModuleHelp(int moduleId) {
		return mgr.getModuleHelp(moduleId);
	}

	@Override
	public GlobalModuleInfo saveModuleHelp(int orgId, int propId, int userId,
			boolean isSchedule, Date startDate, Date startTime,
			Map<String, String> titleTextMap,
			Map<String, String> subTitleTextMap, byte[] menuPictureData,
			List<MdlHelpMain> helpMainList) {
		return mgr.saveModuleHelp(orgId, propId, userId, isSchedule, startDate, startTime, titleTextMap, subTitleTextMap, menuPictureData, helpMainList);
	}

	@Override
	public void saveHelpTemplate(int orgId, int propId, int userId,
			Map<String, String> titleMap, Map<String, String> subTitleMap,
			byte[] menuPictureData, List<MdlHelpMain> helpMainList,
			String templateName) {
		mgr.saveHelpTemplate(orgId, propId, userId, titleMap, subTitleMap, menuPictureData, helpMainList, templateName);
	}
}
